﻿
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace WinnerCMS.Data.Mapping
{
    public partial class BankrollListMap
        : System.Data.Entity.ModelConfiguration.EntityTypeConfiguration<WinnerCMS.Model.BankrollList>
    {
        public BankrollListMap()
        {
            // table
            //ToTable("CMS_BankrollList");

            // keys
            HasKey(t => t.Id);

            // Properties
            Property(t => t.Id)
                
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity)
                .IsRequired();
            Property(t => t.UserName)
                
                .HasMaxLength(50)
                .IsRequired();
            Property(t => t.ClientId)
                
                .IsRequired();
            Property(t => t.Money)
                
                .HasPrecision(19, 4)
                .IsRequired();
            Property(t => t.MoneyType)
                
                .IsRequired();
            Property(t => t.CurrencyType)
                
                .IsRequired();
            Property(t => t.EBankId)
                
                .IsRequired();
            Property(t => t.Bank)
                
                .HasMaxLength(50)
                .IsRequired();
            Property(t => t.IncomePayOut)
                
                .IsRequired();
            Property(t => t.OrderId)
                
                .IsRequired();
            Property(t => t.PaymentId)
                
                .IsRequired();
            Property(t => t.Remark)
                
                .HasMaxLength(255)
                .IsRequired();
            Property(t => t.LogTime)
                
                .IsRequired();
            Property(t => t.Admin)
                
                .HasMaxLength(50)
                .IsRequired();
            Property(t => t.IP)
                
                .HasMaxLength(50)
                .IsRequired();
            Property(t => t.CheckInDate)
                
                .IsRequired();
            Property(t => t.Deleted)
                
                .IsRequired();

            // Relationships
            HasRequired(t => t.Order)
               .WithMany(t => t.BankrollLists)
               .HasForeignKey(d => d.OrderId);


            //InitializeMapping();
        }
    }
}

